<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3D导航栏</title>
    <style>

        *{
            margin: 0;
            padding: 0;
        }

        .box{
            width: 100px;
            height: 50px;
            position: relative;
            margin: 100px auto;
            transform-style: preserve-3d;
            transition: all 1s;
        }

        .box:hover{
            transform: rotateX(90deg);
        }

        .front,.bottom{
            position: absolute;
            width: 100%;
            height: 100%;
            line-height: 50px;
            text-align: center;
        }

        .front{
            background-color: purple;
            transform: translateZ(25px);
        }

        .bottom{
            background-color: red;
            transform: translateY(25px) rotateX(-90deg);
        }

        ul li{
            list-style: none;
            float: left;
            margin: 0 5px;
            width: 120px;
            height: 50px;
            perspective: 500px;
        }
    </style>
</head>

<body>
    <ul>
        <li>
            <div class="box">
                <div class="front">
                    邓猪猪
                </div>
                <div class="bottom">
                    早上好
                </div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">
                    邓猪猪
                </div>
                <div class="bottom">
                    起床了吗
                </div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">
                    邓猪猪
                </div>
                <div class="bottom">
                    该减肥了
                </div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">
                    邓猪猪
                </div>
                <div class="bottom">
                    今天继续加油
                </div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">
                    邓猪猪
                </div>
                <div class="bottom">
                    明天就54啦
                </div>
            </div>
        </li>
    </ul>
</body>

</html>